home *** CD-ROM | disk | FTP | other *** search
- /* string.h standard header */
- #ifndef _STRING
- #define _STRING
- #ifndef _YVALS
- #include <yvals.h>
- #endif
-
- #if __MWERKS__
- #pragma options align=mac68k
- #endif
-
- /* macros */
- #ifndef NULL
- #define NULL _NULL
- #endif
- /* type definitions */
- #ifndef _SIZET
- #define _SIZET
- typedef _Sizet size_t;
- #endif
- /* declarations */
- _C_LIB_DECL
- int memcmp(const void *, const void *, size_t);
- void *memcpy(void *, const void *, size_t);
- void *memmove(void *, const void *, size_t);
- void *memset(void *, int, size_t);
- char *strcat(char *, const char *);
- int strcmp(const char *, const char *);
- int strcoll(const char *, const char *);
- char *strcpy(char *, const char *);
- size_t strcspn(const char *, const char *);
- char *strerror(int);
- size_t strlen(const char *);
- char *strncat(char *, const char *, size_t);
- int strncmp(const char *, const char *, size_t);
- char *strncpy(char *, const char *, size_t);
- size_t strspn(const char *, const char *);
- char *strtok(char *, const char *);
- size_t strxfrm(char *, const char *, size_t);
- char *_Strerror(int, char *);
- _END_C_LIB_DECL
-
- #ifdef __MWERKS__
- /* externally set this to 1 in order to force the ANSI calls */
- #ifndef _NO_FAST_STRING_INLINES_
- #define _NO_FAST_STRING_INLINES_ 0
- #endif
- #if !defined(powerc) && !_NO_FAST_STRING_INLINES_
- /* use 680x0 assembler inlines for these routines */
- _C_LIB_DECL
- size_t __strlen(const char *:__A0):__D0 =
- { 0x70FF,0x5280,0x4A18,0x66FA };
- char *__strcpy(char *:__A0,const char *:__A1):__D0 =
- { 0x2008,0x10D9,0x66FC };
- char *__memcpy(void *:__A0,const void *:__A1,size_t:__D1):__D0 =
- { 0x2008,0x4A81,0x6706,0x10D9,0x5381,0x66FA };
- _END_C_LIB_DECL
- /* macro overrides, for C */
- #define strlen(x) __strlen(x)
- #define strcpy(x,y) __strcpy((x),(y))
- #define memcpy(x,y,z) __memcpy((x),(y),(z))
- #endif
- #endif
-
- #ifdef __cplusplus
- /* inlines and overloads, for C++ */
- #define _Const_return const
- _C_LIB_DECL
- void *memchr(const void *, int, size_t);
- char *strchr(const char *, int);
- char *strpbrk(const char *, const char *);
- char *strrchr(const char *, int);
- char *strstr(const char *, const char *);
- _END_C_LIB_DECL
- inline void *memchr(void *s, int c, size_t n)
- {return (void *)memchr((const void *)s, c, n);}
- inline char *strchr(char *s, int c)
- {return (char *)strchr((const char *)s, c);}
- inline char *strpbrk(char *s, const char *p)
- {return (char *)strpbrk((const char *)s, p);}
- inline char *strrchr(char *s, int c)
- {return (char *)strrchr((const char *)s, c);}
- inline char *strstr(char *s, const char *p)
- {return (char *)strstr((const char *)s, p);}
- inline char *strerror(int _Err)
- {return _Strerror(_Err, 0); }
- #else
- #define _Const_return
- void *memchr(const void *, int, size_t);
- char *strchr(const char *, int);
- char *strpbrk(const char *, const char *);
- char *strrchr(const char *, int);
- char *strstr(const char *, const char *);
- /* macro overrides, for C */
- #define strerror(err) _Strerror(err, 0)
- #endif
-
- #if __MWERKS__
- #pragma options align=reset
- #endif
-
- #endif
-
-
- /*
- * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
- * Consult your license regarding permissions and restrictions.
- */
-
- /* Change log:
- *94June04 PlumHall baseline
- *94Oct07 Inserted MW changes.
- */
-